package com.azzcs.myrpc.autoconfig;

import com.azzcs.myrpc.serializer.JSONSerializer;
import com.azzcs.myrpc.serializer.Serializer;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: wzg
 * @Date: 2021/1/23 上午10:08
 */
@Configuration
public class MyRpcAutoConfig {

    @Bean
    @ConditionalOnMissingBean(type = "com.azzcs.myrpc.serializer.Serializer")
    public Serializer serializer() {
        return new JSONSerializer();
    }

}
